/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.pucp.Envios.Vista;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.awt.event.KeyListener;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import pe.edu.pucp.Modelo.Ciudad;
import pe.edu.pucp.Modelo.Cliente;
import pe.edu.pucp.Modelo.Continente;
import pe.edu.pucp.Modelo.Envio;
import pe.edu.pucp.Modelo.NotaCredito;
import pe.edu.pucp.Modelo.Pais;
import pe.edu.pucp.Modelo.TipoCorreo;
import pe.edu.pucp.Modelo.TipoPago;
import pe.edu.pucp.Util.ValHelper;
import pe.edu.pucp.sigepa.recocidosimulado.domain.interfaz.Solucion;

/**
 *
 * @author katy
 */
public class GenerarEnviosGUI extends javax.swing.JDialog {

    Ciudad ciudadorigen;
    Ciudad ciudaddestino;
    Continente continente;
    Pais pais;
    Envio envio;
    JFrame padre;
  
    public GenerarEnviosGUI(JFrame parent, boolean modal) {
        super(parent, modal);
        this.padre = parent;
        this.initComponents();
        this.setLocationRelativeTo(null);
        ((JTextField)dtcFecha.getDateEditor()).setEditable(false);    
        this.txtReceptor.setTransferHandler(null);
        this.txtDireccion.setTransferHandler(null);
        this.txtPaquetes.setTransferHandler(null);
        
   
    }
    
    public void mostrarInicioProceso(boolean b){
        this.btnCerrar.setEnabled(!b);
        this.btnGenerarItinirario.setEnabled(!b);
        this.btnGuardar.setEnabled(!b);
        this.btnVerMapa.setEnabled(!b);
    }
    
    public JFrame getPadre() {
        return this.padre;
    }
    
    public String getFilePath(){
        return this.txtPathArchivo.getText();
    }
    
    public JButton getAlgoritmoBtn() {
        return this.btnGenerarItinirario;
    }
    
    public void SetValues(Ciudad ciudad, Cliente c){
        txtCiudad.setText(ciudad.getDescripcion()); 
        txtCliente.setText(c.getNombre()+" "+ c.getAppaterno()+ " "+ c.getApmaterno());
    }
    
    public void setEnabledCancelacion(boolean b) {
        btnCerrar.setEnabled(b);
         this.btnGenerarItinirario.setEnabled(b);
    }
    
    public void setNombrePathArchivo(String path) {
        txtPathArchivo.setText(path);
    }

    
    public void SetBloquearCancelar() {
        btnCerrar.setEnabled(false);
    }
    
    public void addGenerarButtonListener(ActionListener listener){      
       btnGenerarItinirario.addActionListener(listener);
    }
    
    public void addVerRecorrido (ActionListener listener) {
        btnVerMapa.addActionListener(listener);
    }
    
    public void addAbrifFileListener(ActionListener listener) {
       btnFile.addActionListener(listener);
    }
    
    public void addSoloTextoListener(KeyListener listener) {
        this.txtReceptor.addKeyListener(listener);
        this.txtDireccion.addKeyListener(listener);
    }
    
    public void addSoloNumeros(KeyListener listener) {
        this.txtPaquetes.addKeyListener(listener);
    }
    
    public void llenaTipoCorreo(ArrayList<TipoCorreo> lst) {
        int defaultIndex = 0; 
        if(lst != null){
            for (int i = 0; i < lst.size(); i++){
                TipoCorreo t = lst.get(i);            
                cmbEmail.addItem(t.getExtension());
            }
        }
        cmbEmail.setSelectedIndex(defaultIndex);
    }
    
    public void llenaContinentes(ArrayList<Continente> lst) {
        cmbCiudad.removeAllItems();
        if(lst != null){
            for (Continente c : lst){
              cmbContinente.addItem(c.getDescripcion());
            }
        }
    }
    
    public void llenaGrilla(Solucion lista){        
        String mensaje;
        SimpleDateFormat formato = new SimpleDateFormat("hh:mm:ss");
        if(lista!=null){ 
            ((DefaultTableModel) this.tblResultados.getModel()).setRowCount(0);
            for (int f = 0; f<lista.size();f++){
                ((DefaultTableModel) tblResultados.getModel()).setRowCount(tblResultados.getRowCount()+1);

                tblResultados.setValueAt(lista.get(f).getAeropuertoOrigen().getCiudad().getDescripcion(),f,0);
                tblResultados.setValueAt(formato.format(lista.get(f).getSalidaest()),f,1);                
                tblResultados.setValueAt(lista.get(f).getAeropuertoDestino().getCiudad().getDescripcion(),f,2);           
                tblResultados.setValueAt(formato.format(lista.get(f).getLlegadaest()), f, 3);                
             }
            mensaje = "Solución encontrada: " + (lista.size()-1) + " escalas determinadas.";

         } else mensaje = "No se encontró una ruta.";
    }
    
    public int getContinente(){        
        return cmbContinente.getSelectedIndex();
    }
    
    public int getPais(){
        return cmbPais.getSelectedIndex();
    }
    
    public int getCiudad(){
        return cmbCiudad.getSelectedIndex();
    }
    
    public int getTipoPago(){
        return cmbtipoPago.getSelectedIndex();
    }
    
    public int getNotaCredito(){
        return cmbnotaCredito.getSelectedIndex();
    }
    
    public int getTipoEmail(){
        return cmbEmail.getSelectedIndex();
    }
    
    public void llenaPaises(ArrayList<Pais> lst) {
        cmbPais.removeAllItems();
        if(lst != null){
            for (Pais c : lst){
                cmbPais.addItem(c.getDescripcion());
            }
        }
    }
    
    public void llenaCiudades(ArrayList<Ciudad> lst) {
        cmbCiudad.removeAllItems();
        if(lst != null){
            for (Ciudad c : lst){
                cmbCiudad.addItem(c.getDescripcion());
            }
        }
    }
    
    public String getPaquetes(){
        return txtPaquetes.getText();
    }
    
    public String getReceptor(){
        return txtReceptor.getText();
    }
    
    public String getDireccion(){
        return txtDireccion.getText();
    }
    
    public String getEmail(){
        return txtEmail.getText();
    }
    
    public void addCambiarContinente(ItemListener ml){
        this.cmbContinente.addItemListener(ml);
    }     
    
    public void addCambiarPais(ItemListener ml){
        this.cmbPais.addItemListener(ml);
    }      
    
    public void addCerrarVentanEnvioListener(ActionListener listener) {
        this.btnCerrar.addActionListener(listener);
    }
    
    public void addGuardarEnvioButtonListener(ActionListener listener) {
        this.btnGuardar.addActionListener(listener);
    }
    
    public void setIGV(String IGV){
        txtIGV.setText(IGV);
    }
    
    public void setFecha(Date fecha){        
        dtcFecha.setDate(fecha);
    }
    
    public void setPaquetesFinal(String paquetes){
        txtPaquetesFinal.setText(paquetes);
    }
    
    public void setTotal(String total){
        txtTotal.setText(total);
    }
    
    public double getTotal(){
        return Double.valueOf(txtTotal.getText());
    }
    
    public String getTarjeta(){
        return txtTarjeta.getText();
    }
    
    public void setCostoUnitario(String costoU){
        txtcostoUnitario.setText(costoU);
    }
    
    public void setSubTotal(String subTotal){
        txtsubTotal.setText(subTotal);
    }
    
    public void enableTarjeta(){
        txtTarjeta.setVisible(true);
        lblTarjeta.setVisible(true);
    }
    
    public void disableTarjeta(){
        txtTarjeta.setVisible(false);
        lblTarjeta.setVisible(false);
    }
    
    public void enableNotacredito(){
        cmbnotaCredito.setVisible(true);
        lblNota.setVisible(true);
    }
    
    public void disableNotacredito(){
        cmbnotaCredito.setVisible(false);
        lblNota.setVisible(false);
    }
    
    public void llenarMensaje(String servicio, String origen){
        lblServicio.setText(servicio);
        lblOrigen.setText(origen);
    }
    
    public void llenaTipoPago(ArrayList<TipoPago> lst) {      
        if(lst != null){
            for (int i = 0; i < lst.size(); i++){
                TipoPago t = lst.get(i);              
                cmbtipoPago.addItem(t.getDescripcion());
            }
        }        
    }
    public void llenaNotaCredito(ArrayList<NotaCredito> lst) {      
      if(lst != null){
          for (int i = 0; i < lst.size(); i++){
              NotaCredito t = lst.get(i);              
              cmbnotaCredito.addItem(t.getIdnotacredito());
          }
      }        
    }
    
    public void addCambiarPago(ItemListener ml){
        this.cmbtipoPago.addItemListener(ml);
    }   
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtCiudad = new javax.swing.JTextField();
        txtPaquetes = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        cmbContinente = new javax.swing.JComboBox();
        cmbPais = new javax.swing.JComboBox();
        cmbCiudad = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        txtCliente = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        txtReceptor = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        txtDireccion = new javax.swing.JTextField();
        txtEmail = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        cmbEmail = new javax.swing.JComboBox();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblResultados = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        txtcostoUnitario = new javax.swing.JTextField();
        txtPaquetesFinal = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        txtsubTotal = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        txtIGV = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        txtTotal = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        cmbtipoPago = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        dtcFecha = new com.toedter.calendar.JDateChooser();
        lblTarjeta = new javax.swing.JLabel();
        txtTarjeta = new javax.swing.JTextField();
        lblNota = new javax.swing.JLabel();
        cmbnotaCredito = new javax.swing.JComboBox();
        jPanel5 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        lblServicio = new javax.swing.JLabel();
        lblOrigen = new javax.swing.JLabel();
        btnGuardar = new javax.swing.JButton();
        btnGenerarItinirario = new javax.swing.JButton();
        btnCerrar = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        txtPathArchivo = new javax.swing.JTextField();
        btnFile = new javax.swing.JButton();
        btnVerMapa = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("SIGEPA - Registrar Envío");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Envío"));

        jLabel1.setText("Ciudad Origen: ");

        jLabel2.setText("Ciudad Destino:");

        jLabel3.setFont(new java.awt.Font("Ubuntu", 0, 15)); // NOI18N
        jLabel3.setText("Nro Paquetes:");

        txtCiudad.setEditable(false);
        txtCiudad.setEnabled(false);

        jLabel4.setText("Continente Destino:");

        jLabel5.setText("País Destino:");

        jLabel6.setFont(new java.awt.Font("Ubuntu", 0, 15)); // NOI18N
        jLabel6.setText("Cliente:");

        txtCliente.setEnabled(false);

        jLabel7.setFont(new java.awt.Font("Ubuntu", 0, 15)); // NOI18N
        jLabel7.setText("Receptor:");

        jLabel8.setFont(new java.awt.Font("Ubuntu", 0, 15)); // NOI18N
        jLabel8.setText("Dirección:");

        jLabel16.setFont(new java.awt.Font("Ubuntu", 0, 15)); // NOI18N
        jLabel16.setText("Email:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel6)
                            .addComponent(jLabel3)
                            .addComponent(jLabel16)
                            .addComponent(jLabel8))
                        .addGap(12, 12, 12)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtPaquetes, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(txtEmail, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)
                                        .addComponent(txtReceptor, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtCliente, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtCiudad, javax.swing.GroupLayout.Alignment.LEADING)))
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(12, 12, 12)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel2))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(cmbPais, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(cmbContinente, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(cmbCiudad, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addContainerGap())
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(cmbEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 368, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmbContinente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel1)
                        .addComponent(jLabel4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cmbPais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel5))
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel3)
                                    .addComponent(txtPaquetes, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel7))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(33, 33, 33)
                                .addComponent(txtReceptor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel16)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(cmbEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(cmbCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tblResultados.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "CIUDAD ORIGEN", "HORA SALIDA", "CIUDAD DESTINO", "HORA LLEGADA"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblResultados.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tblResultados);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(54, 54, 54))
        );

        jTabbedPane1.addTab("Itinerario", jPanel1);

        jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Detalle pago"));

        jLabel12.setText("Nro. Paquetes:");

        jLabel11.setText("Costo unitario:");

        txtcostoUnitario.setEditable(false);
        txtcostoUnitario.setMaximumSize(new java.awt.Dimension(110, 27));
        txtcostoUnitario.setMinimumSize(new java.awt.Dimension(110, 27));
        txtcostoUnitario.setPreferredSize(new java.awt.Dimension(110, 27));

        txtPaquetesFinal.setEditable(false);

        jLabel17.setText("SubTotal");

        txtsubTotal.setEditable(false);

        jLabel18.setText("IGV:");

        txtIGV.setEditable(false);

        jLabel9.setText("TOTAL:");

        txtTotal.setEditable(false);

        jLabel10.setText("Tipo pago:");

        jLabel13.setText("Fecha pago:");

        dtcFecha.setEnabled(false);

        lblTarjeta.setText("Nro. Tarjeta:");

        lblNota.setText("Nota crédito:");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtTotal)
                    .addComponent(txtsubTotal, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtPaquetesFinal, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtIGV)
                    .addComponent(txtcostoUnitario, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE))
                .addGap(61, 61, 61)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(lblTarjeta)
                    .addComponent(lblNota)
                    .addComponent(jLabel13))
                .addGap(39, 39, 39)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(cmbtipoPago, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(txtTarjeta)
                    .addComponent(dtcFecha, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)
                    .addComponent(cmbnotaCredito, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(20, 20, 20))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(txtcostoUnitario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtPaquetesFinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtsubTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel17))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtIGV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(jLabel10)
                            .addComponent(cmbtipoPago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(lblTarjeta)
                            .addComponent(txtTarjeta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblNota)
                            .addComponent(cmbnotaCredito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel13)
                            .addComponent(dtcFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Detalle servicio"));

        jLabel14.setText("Servicio:");

        jLabel15.setText("Origen:");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(jLabel15))
                .addGap(59, 59, 59)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblOrigen)
                    .addComponent(lblServicio))
                .addContainerGap(557, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(lblServicio))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(lblOrigen))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14))
        );

        jTabbedPane1.addTab("Pago Itinerario", jPanel3);

        btnGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recurso/checkmark.png"))); // NOI18N
        btnGuardar.setToolTipText("Guardar Envio Completo");
        btnGuardar.setEnabled(false);

        btnGenerarItinirario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recurso/process.png"))); // NOI18N
        btnGenerarItinirario.setToolTipText("Generar Ruta");

        btnCerrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recurso/delete.png"))); // NOI18N
        btnCerrar.setToolTipText("Cerrar");

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Archivos")));

        jLabel19.setText("Archivo:");

        txtPathArchivo.setEditable(false);
        txtPathArchivo.setText("/home");

        btnFile.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recurso/folder.png"))); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(txtPathArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, 511, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnFile, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(btnFile, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPathArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19))
                .addGap(0, 12, Short.MAX_VALUE))
        );

        btnVerMapa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recurso/photo.png"))); // NOI18N
        btnVerMapa.setEnabled(false);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnVerMapa)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnGenerarItinirario, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTabbedPane1)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnGuardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnGenerarItinirario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnCerrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnVerMapa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCerrar;
    private javax.swing.JButton btnFile;
    private javax.swing.JButton btnGenerarItinirario;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JButton btnVerMapa;
    private javax.swing.JComboBox cmbCiudad;
    private javax.swing.JComboBox cmbContinente;
    private javax.swing.JComboBox cmbEmail;
    private javax.swing.JComboBox cmbPais;
    private javax.swing.JComboBox cmbnotaCredito;
    private javax.swing.JComboBox cmbtipoPago;
    private com.toedter.calendar.JDateChooser dtcFecha;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JLabel lblNota;
    private javax.swing.JLabel lblOrigen;
    private javax.swing.JLabel lblServicio;
    private javax.swing.JLabel lblTarjeta;
    private javax.swing.JTable tblResultados;
    private javax.swing.JTextField txtCiudad;
    private javax.swing.JTextField txtCliente;
    private javax.swing.JTextField txtDireccion;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtIGV;
    private javax.swing.JTextField txtPaquetes;
    private javax.swing.JTextField txtPaquetesFinal;
    private javax.swing.JTextField txtPathArchivo;
    private javax.swing.JTextField txtReceptor;
    private javax.swing.JTextField txtTarjeta;
    private javax.swing.JTextField txtTotal;
    private javax.swing.JTextField txtcostoUnitario;
    private javax.swing.JTextField txtsubTotal;
    // End of variables declaration//GEN-END:variables
}
